<?php
/**
 * Created by PhpStorm.
 * User: lee
 * Date: 2018/11/20
 * Time: 3:31 PM
 */
namespace Biz\model\eventlog;

/**
 *
 * @author lee
 *
 */
class General extends \Doraemon\pockets\datebase\BaseDbModel
{

    const _CONFIG_FILE_ = 'db_eventlog';

    const _CONFIG_SELECT_ = 'db_event_log';

    const _DATABASE_ = 'biz_event_log';

    const _TABLE_NAME = 'general';

    public static function createLog($eventTag,$eventId,$msgId,$data=[],$msgAddtime=''){
        $data = [
            'event_tag'=>$eventTag,
            'event_id'=>$eventId,
            'msg_id'=>$msgId,
            'msg_addtime'=>$msgAddtime,
            'content'=>json_encode($data,JSON_UNESCAPED_UNICODE),
            'addtime'=>date('Y-m-d H:i:s')
        ];

        self::insert($data);

        $id = self::id();

        return $id;
    }

}

